package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable5;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable5.UserBaseTable5DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable5.vo.*;

/**
 * 公积金贷 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable5Mapper extends BaseMapperX<UserBaseTable5DO> {

    default PageResult<UserBaseTable5DO> selectPage(UserBaseTable5PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable5DO>()
                .eqIfPresent(UserBaseTable5DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable5DO::getIsPayment, reqVO.getIsPayment())
                .eqIfPresent(UserBaseTable5DO::getIsHouse, reqVO.getIsHouse())
                .eqIfPresent(UserBaseTable5DO::getPropertyStatus, reqVO.getPropertyStatus())
                .betweenIfPresent(UserBaseTable5DO::getUnitTime, reqVO.getUnitTime())
                .eqIfPresent(UserBaseTable5DO::getNatureOfUnit, reqVO.getNatureOfUnit())
                .eqIfPresent(UserBaseTable5DO::getJob, reqVO.getJob())
                .eqIfPresent(UserBaseTable5DO::getPolicyYearPayment, reqVO.getPolicyYearPayment())
                .betweenIfPresent(UserBaseTable5DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable5DO::getId));
    }

    default List<UserBaseTable5DO> selectList(UserBaseTable5ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable5DO>()
                .eqIfPresent(UserBaseTable5DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable5DO::getIsPayment, reqVO.getIsPayment())
                .eqIfPresent(UserBaseTable5DO::getIsHouse, reqVO.getIsHouse())
                .eqIfPresent(UserBaseTable5DO::getPropertyStatus, reqVO.getPropertyStatus())
                .betweenIfPresent(UserBaseTable5DO::getUnitTime, reqVO.getUnitTime())
                .eqIfPresent(UserBaseTable5DO::getNatureOfUnit, reqVO.getNatureOfUnit())
                .eqIfPresent(UserBaseTable5DO::getJob, reqVO.getJob())
                .eqIfPresent(UserBaseTable5DO::getPolicyYearPayment, reqVO.getPolicyYearPayment())
                .betweenIfPresent(UserBaseTable5DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable5DO::getId));
    }

}
